﻿using Microsoft.AspNetCore.Identity;

namespace mozhi.smarterp.AuthorCenter.TokenProviders
{
    public static class IdentityBuilderExtensions
    {
        public static IdentityBuilder AddLinkUserLoginProvider(this IdentityBuilder builder)
        {
            var userType = builder.UserType;
            var totpProvider = typeof(LinkUserLoginProvider<>).MakeGenericType(userType);
            return builder.AddTokenProvider("LinkLoginProvider", totpProvider);
        }
    }
}
